package com.tjbklx1.thread.chap01.demo01;

public class UserThread extends Thread {

	private final Gate gate;
	private final String name;
	private final String addr;

	public UserThread(Gate gate, String name, String addr) {
		this.gate = gate;
		this.name = name;
		this.addr = addr;
	}
	
	@Override
	public void run() {
		System.out.println(name +" BEGIN");
		while(true){
			gate.pass(name,addr);
		}
	}
}
